<html>
<head>
    <meta charset="utf-8">
    <title>电信通信</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="../../css/font_eolqem241z66flxr.css" media="all"/>
    <link rel="stylesheet" href="../../css/user.css" media="all"/>
</head>
<body class="childrenBody">
<blockquote class="layui-elem-quote layui-quote-nm">
    <div style="text-align: center; padding:1% 0;">
        <p style="font-size: 20px; font-weight: 300; color: #999;">电信通信信息</p>
    </div>
</blockquote>
<table class="layui-hide" id="test"></table>

<script type="text/javascript" src="../../layui/layui.js"></script>
<script type="text/javascript" src="../../js/jquery-3.1.1.min.js"></script>
<script type="text/javascript">
    layui.use('table', function () {
        var table = layui.table;

        //执行一个 table 实例
        table.render({
            elem: '#test'
            , height: 600
            , headers: {'educoder': 'sasasas'}
            , limit: 10
            , method: 'post'
            , limits: [10, 20, 30]
            , url: '/findAllUser' //数据接口
            , page: true //开启分页
            , cols: [[ //表头
                {field: 'id', title: 'ID', width: 80, sort: true, fixed: 'left'}
                , {field: 'userA', title: '呼叫者', width: 200}
                , {field: 'userB', title: '接收者', width: 200}
                , {field: 'startTime', title: '开始时间', width: 200}
                , {field: 'endTime', title: '结束时间', width: 200}
                , {field: 'addressCodeA', title: '呼叫者省份编码', width: 200}
                , {field: 'addressCodeB', title: '接收者省份编码', width: 200}
            ]]
            , done: function (res, curr, count) {
                //如果是异步请求数据方式，res即为你接口返回的信息。
                //如果是直接赋值的方式，res即为：{data: [], count: 99} data为当前页数据、count为数据总长度
                // console.log(res);
                //得到当前页码
                // console.log(curr);
                //得到数据总量
                // console.log(count);
                var limit = res.data.length
                var state = {title: '', url: window.location.href};
                history.pushState(state, '', 'allUsers.html?p=' + curr + "&l=" + limit);
            }
        });

        // table.set({headers:{token: "472EA76F6255CBF8B0ABFAB112FF8F1A"}})
    });
</script>
</body>
</html>